package com.fight.strive.sys.modules.auth.controller;

import com.fight.strive.sys.modules.auth.dto.StriveAuthInfo;
import com.fight.strive.sys.modules.auth.service.StriveAuthService;
import com.fight.strive.sys.modules.common.ReStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/cauth/sys/auth")
public class StriveAuthController {

    @Resource
    private StriveAuthService striveAuthService;

    @PostMapping("/login")
    public ReStatus<StriveAuthInfo> login(
            @RequestBody StriveAuthInfo info) {
        return ReStatus.success(
                striveAuthService.login(info));
    }
}
